import numpy as np
import pandas as pd

# list1 = [1,2,3,4,5]
# arr = np.array(list1)
# print( arr)
# print(type(arr))
# pd.Series(data=arr, index=None, dtype=None)

# color_count = pd.Series({'red':100, 'blue':200, 'green': 500, 'yellow':1000})
# # print(color_count)
# # print(type(color_count))
# print(color_count.index)
# print(color_count.values)

# random_df = pd.DataFrame(np.random.randn(2,3),index=['A','B'],columns=['c1','c2','c3'])
# print(random_df)

#先生成10名同学的5个科目的成绩分数
score = np.random.randint(40,100,(10,5))
print(score)
score_pd = pd.DataFrame(data = score
                        ,columns=['语文','数学','英语','物理','化学']
                        ,index=['小明','小红','小刚','小丽','小蓝','小王','小巴','小网吧','小蛋','小网吧蛋'])
# print(score_pd)
# print(score_pd.shape)
# print(score_pd.index)
# print(score_pd.columns)
# print(score_pd.T)
score_pd.index = ['小明X','小红X','小刚X','小丽X','小蓝X','小王X','小巴X','小网吧X','小蛋X','小网吧蛋X']
print(score_pd)

